/*
 *  Copyright 2001-2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package ar.uba.fi.posgrado.academy.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import ar.uba.fi.posgrado.common.model.AbstractDomainObject;
import ar.uba.fi.posgrado.economy.model.ProviderAccount;

/**
 * Docente
 * 
 * @author ariel.piechotka
 * 
 */

@Entity
@Table(name = "DOCENTE")
@SuppressWarnings("serial")
public class Teacher extends AbstractDomainObject {

	@Column(name = "LEGAJO", length = 10, nullable = false)
	private String fileNumber;

	@Column(name = "NOMBRE", length = 100, nullable = false)
	private String name;

	@Column(name = "FECHA_ALTA", nullable = false)
	private Date validFrom;

	@Column(name = "FECHA_BAJA", nullable = true)
	private Date validTo;

	@Column(name = "TITULO", nullable = false)
	private String degree;
	
	@Column(name = "CURRICULUM", nullable = false)
	private String cv;
	
	@Column(name = "NUMERO_DOCUMENTO", nullable = false)
	private String personalId;
	
	@Column(name = "CUIL_CUIT", nullable = false)
	private String taxId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_ENTE")
	private Body body;

	@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinColumn(name = "ID_CUENTA_CORRIENTE")
	private ProviderAccount account;

	/**
	 * @see ar.uba.fi.posgrado.common.model.AbstractDomainObject#getExcludedFields()
	 */
	@Override
	public String[] getExcludedFields() {
		return new String[] { "body", "account" };
	}

	/**
	 * @return the account
	 */
	public ProviderAccount getAccount() {
		return account;
	}

	/**
	 * @param account
	 *            the account to set
	 */
	public void setAccount(ProviderAccount providerAccount) {
		this.account = providerAccount;
	}

	public String getFileNumber() {
		return fileNumber;
	}

	public void setFileNumber(String fileNumber) {
		this.fileNumber = fileNumber;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getValidFrom() {
		return validFrom;
	}

	public void setValidFrom(Date validFrom) {
		this.validFrom = validFrom;
	}

	public Body getBody() {
		return body;
	}

	public void setBody(Body body) {
		this.body = body;
	}

	public Date getValidTo() {
		return validTo;
	}

	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}

	public String getCv() {
		return cv;
	}

	public void setCv(String cv) {
		this.cv = cv;
	}

	public String getDegree() {
		return degree;
	}

	public void setDegree(String degree) {
		this.degree = degree;
	}

	public String getPersonalId() {
		return personalId;
	}

	public void setPersonalId(String personalId) {
		this.personalId = personalId;
	}

	public String getTaxId() {
		return taxId;
	}

	public void setTaxId(String taxId) {
		this.taxId = taxId;
	}
}
